package ge.testes;

import ge.escola.Sala;

import org.junit.Assert;
import org.junit.Test;


public class TestaSala {

	private Sala sala;
	
	@Test public void TestaConstrutor() throws Exception{
		try{
			sala = new Sala(0,2,"hjdsjfsdhfjdksfljksdfh");
		}
		catch(Exception e){
			Assert.assertEquals("Erro", "Numero digitado invalido", e.getMessage());
		}
		
		try{
			sala = new Sala(1,-5,"hjdsjfsdhfjdksfljksdfh");
		}
		catch(Exception e){
			Assert.assertEquals("Erro", "Numero digitado invalido", e.getMessage());
		}
		
		try{
			sala = new Sala(1,50,"");
		}
		catch(Exception e){
			Assert.assertEquals("Erro", "Descricao invalida", e.getMessage());
		}
	}
	@Test public void TestaSeDadosConferem() throws Exception{
		
		sala = new Sala(1,50,"Sala de reunioes");
		
		Assert.assertEquals(1,sala.getNumeroDeIdentificacao());
		Assert.assertEquals(50,sala.getCapacidadeDeAlunos());
		Assert.assertEquals("Sala de reunioes", sala.getDescricao());
	}
	
	@Test public void TestaOSet() throws Exception{
		sala = new Sala(1,50,"Sala de reunioes");
		try{
			sala.setDescricao("");
		}
		catch(Exception e){
			Assert.assertEquals("Erro", "Descricao invalida", e.getMessage());
		}
		
		sala.setDescricao("Sala de aula");
		
		Assert.assertEquals("Sala de aula", sala.getDescricao());
	
	
	
	}
	
}
